Skip to content

fix: center and properly size event banners regardless of aspect ratio (#746) - #752

Open
Akashstztt wants to merge 2 commits into
Project-HAMi:masterfrom
Akashstztt:fix/746-banner-image-cropping
Open

fix: center and properly size event banners regardless of aspect ratio (#746)#752
Akashstztt wants to merge 2 commits into
Project-HAMi:masterfrom
Akashstztt:fix/746-banner-image-cropping

Conversation

@Akashstztt

@Akashstztt Akashstztt commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Related to #746

What type of PR is this?

/kind bug

What this PR does / why we need it:

The event banner on /landing/kcd-vietnam was being cropped because .banner used object-fit: cover, which is designed for wide/landscape images. This event's banner is square, so key visual content (title, speaker names) was getting cut off.

Fixed by wrapping the banner image in a flex-centered container and using max-width/max-height with object-fit: contain and width/height: auto, so the image sizes itself based on its actual aspect ratio instead of being forced to stretch full-width. This displays square banners fully and centered, while landscape banners (e.g. /landing/kubecon-japan) still fill the width naturally.

Which issue(s) this PR fixes:

Fixes #746

Checklist:

  • npm run lint and npm run format:check pass — note: both report pre-existing repo-wide issues unrelated to this PR (a Windows markdownlint CLI quirk, and 482 files with existing Prettier formatting drift). Neither of the two files changed in this PR is affected.
  • npm run build succeeds for both en and zhnot verified locally due to a Windows-specific NODE_OPTIONS shell syntax issue in this environment; CI will validate this on Linux.
  • Chinese translation updated if English docs changed (or noted why not) — N/A, CSS/layout-only change, no text content changed
  • Commits are signed off (git commit -s)

Testing:

  • Verified /landing/kcd-vietnam banner (square image) now displays fully, centered, with no cropping or letterboxing.
  • Verified /landing/kubecon-japan banner (landscape image) still displays correctly with no regression.
  • Confirmed EventLanding.module.css is only imported by EventLanding.js, which is only used by these two event pages — no other pages affected by this change.
Screenshot 2026-08-10 155638 Screenshot 2026-08-10 155633

@hami-robot hami-robot Bot added kind/bug Something isn't working dco-signoff: yes labels Aug 10, 2026
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for project-hami ready!

Name Link
🔨 Latest commit 7cee868
🔍 Latest deploy log https://app.netlify.com/projects/project-hami/deploys/6a79a8899eefac000866093b
😎 Deploy Preview https://deploy-preview-752--project-hami.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@hami-robot
hami-robot Bot requested review from mesutoezdil and wawa0210 August 10, 2026 10:01
@hami-robot

hami-robot Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Akashstztt
Once this PR has been reviewed and has the lgtm label, please assign windsonsea for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The event banner image is wrapped in a centered container. Its styles now preserve intrinsic sizing, use contain fitting, and add bottom spacing.

Changes

Event banner layout

Layer / File(s) Summary
Banner rendering and sizing
src/components/EventLanding.js, src/components/EventLanding.module.css
The banner image is rendered inside bannerWrapper. The wrapper centers the image and adds bottom spacing. The banner uses intrinsic sizing, contain fitting, and block display instead of full-width cover fitting.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: fishman

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #746 by preventing banner cropping and centering banners with preserved aspect ratios.
Out of Scope Changes check ✅ Passed All changes are limited to event banner structure and styling required by issue #746.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: centering event banners and sizing them correctly for different aspect ratios.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/EventLanding.module.css`:
- Around line 18-23: Update the .banner styling so max-height: 480px applies
only to square and portrait banners, while landscape banners can scale to the
available wrapper width without the global height cap. Preserve intrinsic
aspect-ratio behavior and the existing max-width constraint.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 295087f8-3f4b-4f04-8648-36dce6bb989a

📥 Commits

Reviewing files that changed from the base of the PR and between 1286516 and 3472240.

📒 Files selected for processing (2)
  • src/components/EventLanding.js
  • src/components/EventLanding.module.css

Comment thread src/components/EventLanding.module.css
…ead of conflicting width/height auto

Signed-off-by: Akash Kumar <akashstzt@gmail.com>
@Akashstztt

Copy link
Copy Markdown
Contributor Author

@mesutoezdil @wawa0210 @rootsongjc — this should now be ready for review. I fixed the CodeRabbit comment about the height cap on landscape banners by using a fixed-size wrapper approach. Let me know if you have any concerns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Fix KCD Vietnam event banner image sizing and cropping

1 participant